INTRODUCTION

In this homework, I’ve tried to find what kind of a relationship between Total House Sales in Turkey, House Price Index, and Housing Loan Interest Rates. Dates are taken from EVDS, The time periods for all datasets are same and between January 2013 to January 2021.

Required Packages

library(tidyverse)
library(lubridate)
library(zoo)
library(ggplot2)
library(readr)
library(readxl)
library(data.table)
library(GGally)
library(skimr)
library(ggcorrplot)
library(plotly)

Reading Datasets and Manipulation

housesales <- read_excel("toplamkonutsatis.xlsx")
housepriceindex <- read_excel("konutfiyatindex.xlsx")
interestrates <- read_excel("konutkredisifaizoranlari.xlsx")

housesales = data.frame(date=as.yearmon(housesales$Tarih), value = housesales$Satis)

housepriceindex = data.frame(date=as.yearmon(housepriceindex$Tarih), value=housepriceindex$`TP HKFE01`)

interestrates = data.frame(date=as.yearmon(interestrates$Tarih), value=interestrates$`TP KTF12`)

Example 1: Number of House Sales in Turkey 1/2013 - 1/2021

hs <- ggplot(housesales, aes(x=date, y=value)) + geom_line() + labs(title = 'House Sales Statistics 2013/1 to 2021/1 ', x= "Date", y = "Number of Houses Sold") 

hs

hsly <- ggplotly(hs)

hsly

Example 2: House Price Index in Turkey 1/2013 - 1/2021

pi <- ggplot(housepriceindex, aes(x=date, y=value)) + geom_line() + labs(title = 'House Price Index Between 2013/1 - 2021/1 ', x= "Date", y = "Price Index (TL) ") 

pily <- ggplotly(pi)

pily

Example 3: Housing Loan Interest Rates in Turkey 1/2013 - 1/2021

hlir <- ggplot(interestrates, aes(x=date, y=value)) + geom_line() + labs(title = 'Housing Loan Interests Between 2013/1 - 2021/1 ', x= "Date", y = "Interest Rate") 

hlirly <- ggplotly(hlir)

hlirly

Visualising House Sales and Interest Rates Together

df1 <- data.frame(housesales, interestrates)

df1 <- df1[,-3]

df1_graph <- ggplot(df1, aes(x=date)) + geom_line(aes(y=scale(value)), colour="black") + geom_line(aes(y=scale(value.1)), colour="blue")


ggplotly(df1_graph)

Visualising House Price Index and Interest Rates Together

df2 <- data.frame(housepriceindex, interestrates)

df2 <- df2[,-3]

df2_graph <- ggplot(df2, aes(x=date)) + geom_line(aes(y=scale(value)), colour="black") + geom_line(aes(y=scale(value.1)), colour="blue")

ggplotly(df2_graph)

##PART B * In this part, we will be looking whis keywords could be related to the above datas, seperately.

“emlakci” Keyword and House Sales

emlakci <- read_excel("emlakcigoogletrend.xlsx")

emlakci = data.frame(date=as.yearmon(emlakci$Ay), value = emlakci$Emlak)


emlakci_graph <- ggplot(emlakci, aes(x=date, y=value)) + geom_line() + labs(title = ' emlakci Keyword Statistics ', x= "Date", y = " Portion ")

ggplotly(emlakci_graph)
df3 <- data.frame(housesales, emlakci)

df3 <- df3[,-3]

df3_graph <- ggplot(df3, aes(x=date)) + geom_line(aes(y=scale(value)), colour="black") + geom_line(aes(y=scale(value.1)), colour="blue")

ggplotly(df3_graph)